package com.xxx.mapper;

import com.xxx.pojo.Package;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface PackageMapper {

    @Select("select * from package;")
    @ResultMap("packageResultMap")
    List<Package> selectAll();

    @Select("select * from package where code = #{code} ;")
    @ResultMap("packageResultMap")
    Package selectByCode(Long code);

    @Delete("delete from package where code = #{code};")
    int delByCode(Long code);


    int updatePackage(@Param("column")String column, @Param("data")String data, @Param("updateTime")String updateTime, @Param("updateUser")Long updateUser, @Param("code")Long code);

    @Insert("insert into package values (#{typesName},#{name},#{price},#{state},#{code},#{describe},#{img},#{createTime},#{updateTime},#{createUser},#{updateUser},#{dele})")
    int addPackage(Package aPackage);
}
